<include file="Public/min-header"/>
<div class="wrapper">
  <include file="Public/breadcrumb"/>
    <section class="content">
        <!-- Main content -->
        <div class="container-fluid">
            <div class="pull-right">
                <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回"><i class="fa fa-reply"></i></a>
            	<a href="javascript:;" class="btn btn-default" data-url="http://www.tp-shop.cn/Doc/Index/article/id/1019/developer/user.html" onclick="get_help(this)"><i class="fa fa-question-circle"></i> 帮助</a>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i>添加评价</h3>
                </div>
                <div class="panel-body">

                    <!--表单数据-->
                    <form method="post" action="{:U('Admin/Order/addComment')}" id="order-add">
                        <div class="tab-pane" >
                            <table class="table table-bordered">
                                <tbody>
                                <input type="hidden" name="goodsId" value="{$goods_id}">
                                <div>
                                    <span>网名</span>
                                <input type="text" class="" name="username" placeholder="请输入网名">
                                <input type="text" class="form-control" name="num" placeholder="请输入">
                                </div>
                                <div>
                                    <span style="padding: 0;">评价内容</span>
                                <textarea class="form-control" cols="10" rows="4" name="content"></textarea>
                                    </div>
                                </tbody>
                                </table>
                        </div>
                        <input type="hidden" name="id" value="{$order.order_id}">
                        <button class="btn btn-info" type="submit" >
                            <i class="ace-icon fa fa-check bigger-110"></i>
                            添加
                        </button>
                    </form> 
                    <script>
                        function checkSubmit()
						{
							$("span[id^='err_']").each(function(){
								$(this).hide();
							});

						   ($.trim($('#consignee').val()) == '') && $('#err_consignee').show();
						   ($.trim($('#province').val()) == '') && $('#err_address').show();
						   ($.trim($('#city').val()) == '') && $('#err_address').show();
						   ($.trim($('#district').val()) == '') && $('#err_address').show();
						   ($.trim($('#address').val()) == '') && $('#err_address').show();
						   ($.trim($('#mobile').val()) == '') && $('#err_mobile').show();
						   ($("input[name^='goods_id']").length ==0) && $('#err_goods').show();

						   if($("span[id^='err_']:visible").length > 0 )
						      return false;

						   $('#order-add').submit();
						}
                    </script>
                </div>
            </div>
<!--订单商品信息--> 
			
<!--订单商品信息 end-->
            
            
        </div>    <!-- /.content -->
    </section>
</div>
<script>
    // 搜索用户 
    function search_user()
	{
		var user_name = $('#user_name').val();
		if($.trim(user_name) == '')
			return false;
			
			 $.ajax({
                type : "POST",
                url:"/index.php?m=Admin&c=User&a=search_user",//+tab,
                data :{search_key:$('#user_name').val()},// 你的formid
                success: function(data){
					data = data + '<option value="0">匿名用户</option>';
					$('#user_id').html(data);
                }
            });		
	}


    /* 用户订单区域选择 */
    $(document).ready(function(){
		/*
		$('#province').val({$order.province});
		$('#city').val({$order.city});
		$('#district').val({$order.district});
		$('#shipping_id').val({$order.shipping_id});
		*/
    })
// 选择商品
function selectGoods(){
    var url = "{:U('Admin/Order/search_goods')}";
    layer.open({
        type: 2,
        title: '选择商品',
        shadeClose: true,
        shade: 0.8,
        area: ['60%', '60%'],
        content: url, 
    });
}
// 选择商品返回
function call_back(table_html)
{
	$('#goods_td').empty().html('<table class="table table-bordered">'+table_html+'</table>');
	layer.closeAll('iframe');
}
</script>
</body>
</html>